Kinetis SDK API Reference Manual  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_soundcard.h File Reference
#include "fsl_os_abstraction.h"
#include "fsl_edma_driver.h"
#include "fsl_sai_driver.h"
#include "fsl_sgtl5000_driver.h"

Data Structures

struct  snd_state_t
 Soundcard status includes the information which the application can see. More...
 
struct  audio_ctrl_operation_t
 The operations of an audio controller, for example SAI, SSI and so on. More...
 
struct  audio_codec_operation_t
 Audio codec operation structure. More...
 
struct  audio_controller_t
 The definition of the audio device which may be a controller. More...
 
struct  audio_codec_t
 The Codec structure. More...
 
struct  audio_buffer_t
 Audio buffer structure. More...
 
struct  sound_card_t
 A sound card includes the audio controller and a Codec. More...
 

Macros

#define AUDIO_CONTROLLER   AUDIO_CONTROLLER_SAI
 Define audio controller sai.
 
#define AUDIO_CONTROLLER_SAI   1
 
#define AUDIO_CODEC   AUDIO_CODEC_SGTL5000
 Define audio codec sgtl5000.
 
#define AUDIO_CODEC_SGTL5000   1
 
#define AUDIO_BUFFER_BLOCK_SIZE   128
 Buffer block size setting.
 
#define AUDIO_BUFFER_BLOCK   2
 Buffer block number setting.
 
#define AUDIO_BUFFER_SIZE   (AUDIO_BUFFER_BLOCK * AUDIO_BUFFER_BLOCK_SIZE)
 
#define AUDIO_TX   1
 Audio transfer direction Tx.
 
#define AUDIO_RX   0
 Audio transfer direction Rx.
 

Typedefs

typedef sai_handler_t ctrl_handler_t
 
typedef sai_user_config_t ctrl_config_t
 
typedef sai_data_format_t ctrl_data_format_t
 
typedef sai_callback_t ctrl_callback_t
 
typedef sai_status_t ctrl_status_t
 
typedef sgtl_handler_t codec_handler_t
 
typedef sgtl_status_t codec_status_t
 

Enumerations

enum  snd_status_t {
  kStatus_SND_Success = 0U,
  kStatus_SND_Fail = 1U,
  kStatus_SND_DmaFail = 2U,
  kStatus_SND_CtrlFail = 3U,
  kStatus_SND_CodecFail = 4U,
  kStatus_SND_BufferAllocateFail = 5U
}
 Soundcard return status. More...
 

Functions

snd_status_t snd_init (sound_card_t *card, void *ctrl_config, void *codec_config)
 Initializes the Soundcard. More...
 
snd_status_t snd_deinit (sound_card_t *card)
 Deinitializes the sound card instance. More...
 
snd_status_t snd_data_format_configure (sound_card_t *card, ctrl_data_format_t *format)
 Configures the audio data format running in the Soundcard. More...
 
uint32_t snd_update_tx_status (sound_card_t *card, uint32_t len)
 Updates the status of the TX. More...
 
uint32_t snd_update_rx_status (sound_card_t *card, uint32_t len)
 Updates status of the RX. More...
 
void snd_get_status (snd_state_t *status, sound_card_t *card)
 Gets the status of the Soundcard. More...
 
void snd_start_tx (sound_card_t *card)
 Starts the Soundcard TX process. More...
 
void snd_start_rx (sound_card_t *card)
 Starts the Soundcard RX process. More...
 
static void snd_stop_tx (sound_card_t *card)
 Stops Soundcard TX process. More...
 
static void snd_stop_rx (sound_card_t *card)
 Stops the Soundcard RX process. More...
 
void snd_wait_event (sound_card_t *card)
 Waits for the semaphore of the write/read data from the internal buffer. More...
 

Variables

audio_ctrl_operation_t g_sai_ops
 
audio_codec_operation_t g_sgtl_ops